//
//  Header.h
//  基本框架
//
//  Created by runone02 on 2018/6/26.
//  Copyright © 2018年 liqiyun. All rights reserved.
//

#ifndef Header_h
#define Header_h
/*
 第三方框架*/
#import "PrefixHeader.h"
#import "Masonry.h"
#import "UIColor+SKYExtension.h"
#import "UIImage+SKYExtension.h"
#import <MJRefresh.h>
#import <MJExtension.h>
#import <TTTAttributedLabel.h>
#import <Bugly/Bugly.h>
#import <AFNetworking.h>
#import <YYKit.h>
#import <AVOSCloud/AVOSCloud.h>
#import <SDImageCache.h>
#import <SVProgressHUD.h>
#import <TZImagePickerController.h>
#import <AFNetworking.h>
#import <SDCycleScrollView.h>
#import <FXDanmaku.h>
#import <FMDB.h>
#import <SDCycleScrollView.h>
#import <CDDPagerController/DCPagerController.h>
#import <SDWebImageCoder.h>
/*Tool*/

#import "ZMColor.h"
#import "ZMUserInfo.h"
#import "ZMViewController.h"
#import "ZMNavView.h"
#import "UIView+extension.h"
#import "NSString+ZMNSString.h"
#import "NSArray+ZMAdd.h"
#import "ZMImageView.h"
#import "ZMCustomGifHeader.h"
#import "ZMCustomGifFooter.h"
#import "ZMNetworkHelper.h"
#import "ZMLoadingView.h"
#import "ZMLoadFailedView.h"
#import "YYTableView.h"
#import "YYTableViewCell.h"
#import "ELViewFactory.h"
#import "UIImageView+WebCache.h"


#define RGB(r,g,b)            RGBA(r,g,b,1.0f)
#define RGBA(r,g,b,a)         [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
#define COLOR_SEPERATOR       RGB(196, 196, 196)
#define COLOR_LIGRAYTITLE     RGB( 196, 196, 196)
#define COLOR_VC_VIEWCOLOR    [UIColor colorWithRed:0.94f green:0.94f blue:0.94f alpha:1.00f]
#define COLOR_BORDERRGB       RGB(176, 176, 176)
#define COLOR_backgroundColor [UIColor colorWithRed:240/255.0 green:242/255.0 blue:245/255.0 alpha:1]

// App主颜色(橙色)
//#define COLOR_THEME             RGB(253, 128, 35)
#define COLOR_THEME             [UIColor orangeColor]
// App字体默认的颜色(灰色)
#define COLOR_TITLEDEFAULTCOLOR RGB(91, 91, 91)
// App分割线颜色(灰色)
#define COLOR_SEPERATORLINE     RGB(197, 197, 197)
#define COLOR_CYAN              [UIColor cyanColor]
#define COLOR_CLEAR             [UIColor clearColor]
#define COLOR_WHITE             [UIColor whiteColor]
#define COLOR_LIGHTGRAY         [UIColor lightGrayColor]
#define COLOR_GRAY              [UIColor grayColor]
#define COLOR_YELLOW            [UIColor yellowColor]
#define COLOR_RED               [UIColor redColor]
#define COLOR_CLEAR             [UIColor clearColor]
#define COLOR_BLACK             [UIColor blackColor]
#define COlOR_BLACK             [UIColor blackColor]


#define kViewWith     self.view.bounds.size.width
#define kViewHeight   self.view.bounds.size.height

#define kStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height//状态栏高
#define kNavBarHeight 44.0
#define kTabBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49) //tabar高
#define kTopBarHeight (kStatusBarHeight + kNavBarHeight)//导航栏高
#define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
#define iPhoneX_BOTTOM_HEIGHT  ([UIScreen mainScreen].bounds.size.height==812?34:0)

/**窗口*/
#define KEYWINDOW [UIApplication sharedApplication].keyWindow
/**屏幕高度*/
#define SCREEN_HEIGHT            [UIScreen mainScreen].bounds.size.height
/**屏幕宽度*/
#define SCREEN_WIDTH             [UIScreen mainScreen].bounds.size.width
//屏幕尺寸
#define MAIN_SIZE ([[UIScreen mainScreen ] bounds ].size)

#define W_RATIO(w)               w*SCREEN_WIDTH/750.f
#define SCALE_HIGHT(controlHight)  (controlHight/1334.0)*SCREEN_HEIGHT
#define SCALE_HIGHT2(controlHight) (SCREEN_HEIGHT(controlHight)>(controlHight/2.0)?(controlHight/1334.0)*SCREEN_HEIGHT:(controlHight/2.0))
#define SCALE_WIDTH(controlWidth) (controlWidth/750.0)*SCREEN_WIDTH

// View 坐标(x,y)和宽高(width,height)
#define X(v)             (v).frame.origin.x
#define Y(v)             (v).frame.origin.y
#define WIDTH(v)         (v).frame.size.width
#define HEIGHT(v)        (v).frame.size.height
#define COLOR_BLACK      [UIColor blackColor]
#define MidX(v)          CGRectGetMidX((v).frame) //横坐标加上到控件中点坐标
#define MidY(v)          CGRectGetMidY((v).frame) //纵坐标加上到控件中点坐标

#define MaxX(v)          CGRectGetMaxX((v).frame) //横坐标加上控件的宽度
#define MaxY(v)          CGRectGetMaxY((v).frame) //纵坐标加上控件的高度

#define FIT_WIDTH   [UIScreen mainScreen].bounds.size.width/375
#define FIT_HEIGHT  [UIScreen mainScreen].bounds.size.height/667
// ** 字体大小*/
#define TITLE_FONT(controlHight)  ([UIScreen mainScreen].bounds.size.width > 400? [UIFont systemFontOfSize:controlHight/2+1]:[UIFont systemFontOfSize:controlHight/2])

#define TITLE_BOLDFONT(controlHight)  ([UIScreen mainScreen].bounds.size.width > 400? [UIFont boldSystemFontOfSize:controlHight/2+1]:[UIFont boldSystemFontOfSize:controlHight/2])

// ** 弱引用*/
#define WeakSelf(weakSelf)        __weak __typeof(&*self)weakSelf = self;
// ** 设置图片*/
#define IMAGE(imageName)       [[UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]

#define   IS_IPAD             (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define   IS_IPHONE           (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define   SCREEN_WIDTH        [UIScreen mainScreen].bounds.size.width
#define   SCREEN_HEIGHT       [UIScreen mainScreen].bounds.size.height
#define   SCREEN_MAX_LENGTH   (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
#define   SCREEN_MIN_LENGTH   (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))
#define   SYSTEM_VERSION      [[UIDevice currentDevice].systemVersion floatValue]
#define   MAIN_COLOR          [UIColor colorWithRed:0 green:(190 / 255.0) blue:(12 / 255.0) alpha:1]
#define   TOPBAR_HEIGHT       ([[UIApplication sharedApplication] statusBarFrame].size.height + [UINavigationController new].navigationBar.frame.size.height)
#define   HEAD_IMG_NAME       @"avatar.jpg"     //自己的头像
#define   USER_NAME           @"Topsky"     //自己的user_name
#define   USER_ID             0   //自己的user_id
#define userSessionToken @"userSessionToken"
#endif /* Header_h */

